 /**
 * 子模块路由
 * DHpai
 */

var router = function($urlRouterProvider, $stateProvider){


 	$stateProvider


    //同步列表
    .state('app.interfaceSyncList', {
        url: "/api/synclist",
        views: {
            'main@' : {
                template : require('./views/synclist.html'),
                controller : 'interfaceSyncList',
            }
        },
        resolve:{
            center_list : function(interfaceservice){
                return interfaceservice.center_list();
            }
         }
    })

    //接口列表
    .state('app.interfaceList', {
        url: "/api/interfacelist",
        views: {
            'main@' : {
                template : require('./views/list.html'),
                controller : 'interfaceList',
            }
        },
        resolve:{
            center_list : function(interfaceservice){
                return interfaceservice.center_list();
            },
            center_list2 : function(interfaceservice){
                return interfaceservice.center_list2();
            }
         }
    })

    //用户侧接口列表
    .state('app.userInterfaceList', {
        url: "/userapi/userinterfacelist",
        views: {
            'main@' : {
                template : require('./views/userinterface.html'),
                controller : 'userInterFace',
            }
        },
        resolve:{
            center_list2 : function(interfaceservice){
                return interfaceservice.center_list2();
            }
         }
    })
   
    //编辑接口
    .state('app.interfaceEdit', {
        url: "/api/interfaceedit/:id",
        views: {
            'main@' : {
                template : require('./views/interfaceinfo.html'),
                controller : 'interfaceEdit',
            }
        }
    })

    //接口参数列表
    .state('app.interfaceParam', {
        url: "/api/interfaceparam/:id",
        views: {
            'main@' : {
                template : require('./views/paramlist.html'),
                controller : 'interfaceParam',
            }
        }
    })



	;

};

module.exports = router;